import { createApp, provide } from 'vue';
import App from './App.vue';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import locale from 'element-plus/lib/locale/lang/zh-cn';

let app = createApp(App)
app.use(ElementPlus, { locale })

import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

import Login from './components/Login.vue';
import { createRouter, createWebHistory } from 'vue-router';
import Student from './components/Student.vue'
import ManagerScholarship from './components/ManagerScholarship.vue'
import Index from './components/Index.vue'
import Welcome from './components/Welcome.vue'
import StudentScholarship from './components/StudentScholarship.vue'
import Owner from './components/Owner.vue'
const routes = [
    {
        path: "/",
        name: "Login",
        component: Login
    }, {
        path: '/index',
        name: "Index",
        component: Index,
        children: [{
            path: '/student',
            name: "Student",
            component: Student
        }, {
            path: '/mscholarship',
            name: "MScholarship",
            component: ManagerScholarship
        }, {
            path: '/welcome',
            name: "Welcome",
            component: Welcome
        }, {
            path: '/sscholarship',
            name: "SScholarship",
            component: StudentScholarship
        }, {
            path: '/owner',
            name: "Owner",
            component: Owner
        }]
    }
]
const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})
app.use(router)
app.mount('#app')
